package net.sysdent.jdbcexplorer.api;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Set;

public class OracleAutocompleteProvider implements AutocompleteProvider {

	public String getSQl() {
		return "SELECT OBJECT_NAME FROM USER_OBJECTS";
	}

	public Set<String> getAutocompleteCollection(ResultSet resultSet) {
		Set<String> user_objects = null;
		if (resultSet != null) {
			user_objects = new HashSet<String>();
			try {
				while (resultSet.next()) {
					user_objects.add(resultSet.getString(1));
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return user_objects;
	}

}
